package com.sky.config;

import com.sky.utils.IdWorkerUtil;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "sky.worker")
@Data
public class IdWorkerConfig {
    private Long workerId;
    private Long datacenterId;
    @Bean
    public IdWorkerUtil IdWorkerConfig(){
        return new IdWorkerUtil(workerId,datacenterId);
    }
}
